<html>
<head><meta charset="utf-8"><title>num_as_ne_bytes use cases · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/num_as_ne_bytes.20use.20cases.html">num_as_ne_bytes use cases</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="239850235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/num_as_ne_bytes%20use%20cases/near/239850235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/num_as_ne_bytes.20use.20cases.html#239850235">(May 22 2021 at 06:38)</a>:</h4>
<p>I feel like <a href="https://github.com/rust-lang/rust/issues/76976">https://github.com/rust-lang/rust/issues/76976</a> is going in circles with "borrowing [as opposed to copying] the bytes of an integer is useful because it lets me borrow the bytes of an integer"</p>



<a name="239878518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/num_as_ne_bytes%20use%20cases/near/239878518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/num_as_ne_bytes.20use.20cases.html#239878518">(May 22 2021 at 15:00)</a>:</h4>
<p><code>&amp;mut</code> is more interesting for in-place modification, but even that is hampered by needing endian-awareness in whatever you pass that to.</p>



<a name="239879819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/num_as_ne_bytes%20use%20cases/near/239879819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/num_as_ne_bytes.20use.20cases.html#239879819">(May 22 2021 at 15:15)</a>:</h4>
<p>why is in-place modification of individual bytes more useful than in-place modification by assigning the result of <code>from_ne_bytes</code> to the entire <code>&amp;mut f64</code> ?</p>



<a name="239879920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/num_as_ne_bytes%20use%20cases/near/239879920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/num_as_ne_bytes.20use.20cases.html#239879920">(May 22 2021 at 15:17)</a>:</h4>
<p>it's not particularly, but also this can be handled flawlessly by crates that already exist today, and it will also be handled by the safe-transmute project.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>